package com.daxue.common.http.config;

import com.daxue.common.http.core.DefaultClient;
import com.daxue.common.http.core.RestClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.retry.annotation.EnableRetry;

/**
 * @author daxue0929
 * @date 2022/4/6
 */

@EnableRetry
@Configuration
public class RestClientAutoConfiguration {

    public RestClientAutoConfiguration() {}

    @Bean
    @Scope("prototype")
    public DefaultClient defaultClient() {

        DefaultClient defaultClient = new DefaultClient();
        defaultClient.reConfig(null);
        return defaultClient;
    }
}
